function RestPhase(RestDuriation,VS)
tic
Screen('FillRect', VS.WindowInfo.window, [0 0 0]);
Screen('Flip', VS.WindowInfo.window);
while toc<RestDuriation-0.005
     [~,~, keyCode] = KbCheck;
     if VS.LabelOn==true
         if toc>0.1
             lptwrite(VS.LabelAddress,0)
         end
     end
        if keyCode(KbName('ESCAPE'))
            VS.Escape=true;
            break
        end
        
end